package com.zd.controller;


import com.zd.config.Result;
import com.zd.entity.LoginEntity;
import com.zd.entity.User;
import com.zd.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author TSP
 * @since 2021-08-27
 */
@RestController
@RequestMapping("/user")
@Api(tags = "UserController", description = "用户表")
public class UserController {

    @Autowired
    private IUserService userService;

    @ApiOperation(value = "根据用户名查询用户")
    @GetMapping(value = "/getByUserName")
    public Result getByUserName(@RequestParam(value = "username", required = true, defaultValue = "admin") String username) {
        return Result.success("成功", userService.getUserByUserName(username));
    }


}
